package gui;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class CurrentRulePanel extends JPanel {

	private JLabel ruleText;
	
	public CurrentRulePanel(){
		setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		JPanel title =  new JPanel();
		title.add(new JLabel("Last rule executed:"));
		JPanel rule = new JPanel();
		ruleText = new JLabel();
		rule.add(ruleText);
		add(title);
		add(rule);
	}
	
	/**
	 * Updates the rule displayed by this panel to the given rule
	 * @param rule The rule to be displayed
	 */
	public void updateRule(String rule){
		ruleText.setText(rule);
	}
}
